package com.bw.controller;

import com.bw.bean.vo;
import com.bw.bean.vo1;
import com.bw.bean.vo2;
import com.bw.service.voservice;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
public class vocontroller {
@Autowired
com.bw.service.voservice voservice;

@RequestMapping("list1")
    public Map list1(){
    List<vo> list = voservice.cx1();
    return SugarUtil.getLineData(list);
}
@RequestMapping("list2")
    public Map list (){
    List list = new ArrayList();
    list.add("名称");
    list.add("总额");
    list.add("用户总数");
    list.add("订单总数");
    List<vo1> list1 = voservice.cx2();
    return SugarUtil.getTablePlayData(list,list1);
}
@RequestMapping("list3")
    public Map list3(){
    double a1 = voservice.cx3();
    return SugarUtil.getFlipNumberData(a1);
}
@RequestMapping("list4")
    public Map list4(){
    List list = new ArrayList();
    list.add("课程名称");
    list.add("订单金额");
    List<vo2> list1 = voservice.cx4();
    return SugarUtil.getTablePlayData(list,list1);


}


}
